package com.sunagy.demand.front.exception;

import com.sunagy.demand.front.enums.BuzEnum;
import lombok.Data;

/**
 * desc：#TODO fill me ！
 * author：三餘無夢生
 * date：2018/4/25
 * time：上午10:38
 */
@Data
public class BuzException extends RuntimeException{

    private static final long serialVersionUID = 1L;
    protected Integer code;
    protected String reason;

    public BuzException(Integer code){
        super(code.toString());
        this.code = code;
    }
    public BuzException(BuzEnum buzEnum){
        super(buzEnum.getMessage());
        this.code = buzEnum.getCode();
    }

    public BuzException(Integer code, String reason) {
        super(code.toString());
        this.code = code;
        this.reason = reason;
    }

}
